<%@ page contentType="text/html; charset=UTF-8" errorPage="./inc/errorpage.jsp"%>
<%@ page import="com.sun.xml.internal.bind.v2.schemagen.xmlschema.Import"%>
<%@ page import="com.health.system.javacommon.util.SpringContextUtil"%>
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.List"%>
<%

String resultStr = " ";

String currUrl="";
String error = request.getParameter("error");
String errorString ="";
if(error!=null&&!"".equals(error)&&error.equals("1")){
	
	session.setAttribute("errorString","您输入的用户名或密码不正确");
}else if(error!=null&&!"".equals(error)&&error.equals("2")){
	session.setAttribute("errorString","您输入的验证码不正确!");
	
}
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title><%=resultStr %>管理平台</title>

<style type="text/css"> 
body,form { margin:0px;  padding:0px}
#loginContainer { background: url(images/login_03.jpg) center no-repeat #fff; width:1000px; height:529px; margin:30px auto 0px auto}
#loginContainer #systemName { font-family:"黑体"; font-size:20px; color:#2b68a9; width:300px; padding:20px 0px 0px 220px}
#loginContainer #inputArea { position:relative; color:#fff; font-size:12px; width:890px; height:30px; margin:315px auto 0px auto}
#loginContainer .user{ background: url(images/group.png) 2px center no-repeat #fff; border:1px solid #ccc; padding:2px 0px 2px 20px; font-size:12px;width:100px}
#loginContainer .password{ background: url(images/lock_edit.png) 2px center no-repeat #fff; border:1px solid #ccc; padding:2px 0px 2px 20px; font-size:12px;width:100px}
#loginContainer .valign{ vertical-align:middle}
#loginContainer .forgetPassword { background:url(images/help_16x16.gif) left center no-repeat; height:16px; padding:0px 0px 0px 20px}
#loginContainer a{ color:#fff; text-decoration:none}
#loginContainer .btnbg{ font-size:12px; background:url(images/login_07.gif) no-repeat; width:72px; height:24px; color:#666; text-align:center; border:none;margin-right: 8px;}
div.error { position: relative; margin: 0 0 8px 0; border: 1px solid; background-position: 10px 11px !important; background-repeat: no-repeat !important; background: #FBE3E4 url(images/jkt-icon_error.gif) 10px 11px no-repeat; border-color: #FBC7C9; font-size: 12px; padding: 10px 10px 10px 36px; line-height: 1.5em; color: #484848;width:160px }
.userPositin { position:absolute; left:60px}
.passwordPositin { position:absolute; left:290px}
.codePositin { position:absolute; left:520px}
</style>

<link href="css/jktcss.css" rel="stylesheet" type="text/css" />
<link type="text/css" rel="Stylesheet"  href="css/redmond/jquery-ui-1.8.10.custom.css" />
<script type="text/javascript" src="js/jquery/jquery-1.5.js"></script>
<script type="text/javascript" src="js/plugin/block/jquery.blockUI.js"></script>
<script type="text/javascript" src="js/jquery/jquery-ui-1.8.9.custom.min.js"></script>
<script>

function KeyDown(e)
{	
	var currKey=0,e=e||event;
　　 currKey=e.keyCode||e.which||e.charCode;
　　 var keyName = String.fromCharCode(currKey);
　　if (currKey == 13)
　　{	
		if(checkForm()){
		　　　　e.returnValue=false;
		　　　　e.cancel = true;
		　　　　document.login.submit();
		
		}
　　}
}

function checkForm(){
	  var thisForm = document.login;


	 if(thisForm.j_username.value==""){
	        $("#errorid").show();
		    document.getElementById("errorid").innerHTML = "用户名不能为空!";
		    thisForm.j_username.focus();
		    return false;
	  }else if(thisForm.j_password.value==""){
	         $("#errorid").show();
		    document.getElementById("errorid").innerHTML = "密码不能为空!";
		    thisForm.j_password.focus();
		    return false;
	  }else if(thisForm.code.value==""){
	         $("#errorid").show();
		    document.getElementById("errorid").innerHTML = "验证码不能为空!";
		    thisForm.code.focus();
		    return false;
	  }
	  //将原来的直接提交登录名,改成:'机构代码+,+登录名';提交到后台 bzq 2011-04-15
	  //thisForm.j_username.value = thisForm.j_username.value+","+thisForm.j_organCode.value;
	  thisForm.submit();
	  thisForm.j_username.value='';
}

function loadimage() {
     
    document.getElementById('imagecode').src='./code.jsp?t='+new Date().getTime();
  }

function freset(obj){
	obj.reset();
	$("#errorid").hide();
}


</script>


</head>

<body >

<div id="loginContainer">
<div id="systemName"><%=resultStr %></div>
<div id="inputArea">
<form id='login' name='login' action='${pageContext.request.contextPath}/j_spring_security_check' method='post' align="center">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:15px">
	  <tr>
	    <td width="60" align="right" valign="middle">用户名：</td>
	    <td width="160" valign="middle"><label class="valign"><input id="j_username" name="j_username" type="text" class="user" /></label></td>
	    <td width="60" align="right" valign="middle">密　码：</td>
	    <td width="160" valign="middle"><label class="valign"><input d="j_password" name="j_password" type="password" class="password" onkeydown="javascript:KeyDown(event)" /></label></td>
	    <td width="60" align="right" valign="middle">验证码：</td>
	    <td valign="middle"><input name="code" type="text" id="textfield3" size="6" maxlength="6" onkeydown="javascript:KeyDown(event)" />
	      <img src="code.jsp" id="imagecode" name="imagecode"  alt="验证码" id="checkcode" width="65" height="20" align="absmiddle" /> 
	      <a href="#" onclick="javascript:loadimage()"> 看不清？</a>
	    </td>
	    
	    <td width="190" align="center"><input name="" type="button" class="btnbg" value="登  录" onClick="javascript:checkForm()" onkeydown="javascript:KeyDown(event)" /> 
	    <input name="" type="reset" class="btnbg" value="重  置" onclick="javascript:freset(document.login);return false" /></td>
	  </tr>
	</table>
</form>
<div id="errorid"  class="error" style="float:right;display:none">
<%	
String errorInfo = (String)session.getAttribute("errorString");
      
if(null!=errorInfo&&!"".equals(errorInfo)){
	%>
	<script>
	document.getElementById("errorid").style.display= "block";
	</script>
	<%
	out.println(errorInfo);
}
%>
</div>



</div>
</div>


</body>
</html>
